package com.kctvjeju.web.common.exception;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;

public class BaseExceptionResolver implements HandlerExceptionResolver{
	
	private String view = null;
	public void setView(String view){
		this.view = view;
	}
	
	@Override
	public ModelAndView resolveException(HttpServletRequest request,
			HttpServletResponse response, Object obj, Exception ex) {
		request.setAttribute("error_message", ex.getMessage());
		System.out.println("BaseExceptionResolver : " + ex.getMessage());
		return new ModelAndView(view);
	}
}
